using Charisma.Tests.Models.BlogApp;
using NUnit.Framework;
using System.Linq;

namespace Charisma.Tests.Linq
{
  [TestFixture]
  public class SimpleTest
  {
    [Test]
    public void MainTest()
    {
      using (var context = new BlogAppContext()) {
        var author = new Author {
                         FirstName = "Joel",
                         LastName = "Spolsky",
                         Contacts = new ContactInfo{Email = "joel.spolsky@acme.com", Phone = "3101010"}
                       };
        context.Persons.Add(author);

        var result = context.Persons.All.ToList();
        Assert.Greater(result.Count, 0);
      }
    }
  }
}